package com.xiangxiangjd.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import com.xiangxiangjd.aop.DictData;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 肖守凯
 * @since 2021-06-11
 */
@Data
@TableName("tr_user")
@ApiModel(value="TrUser对象", description="用户表")
public class TrUser extends Model<TrUser> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "id",type= IdType.ID_WORKER_STR)
    private String id;

    @ApiModelProperty(value = "账户名称")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty(value = "名字")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "邮箱")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "手机号")
    @TableField("phone")
    private String phone;

    @ApiModelProperty(value = "固定电话")
    @TableField("tel")
    private String tel;


    @ApiModelProperty(value = "密码")
    @TableField("pass_word")
    private String passWord;

    @ApiModelProperty(value = "1管理员 /0普通用户 /2超级管理员")
    @TableField("user_admin")
    private String userAdmin;

    @ApiModelProperty(value = "角色id")
    @TableField("role_id")
    private String roleId;

    @ApiModelProperty(value = "单位id")
    @TableField("unit_id")
    private String unitId;

    @ApiModelProperty(value = "单位名字")
    @TableField(exist = false)
    private String unitName;


    @TableField(exist = false)
    private Unit unit;


    @TableField(exist = false)
    private Role role;

    //所有的父级角色
    @TableField(exist = false)
    private List<Role> fatherRoleAll;

    //获取所有的父级单位
    @TableField(exist = false)
    private List<Unit> fatherUnitAll;



    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }
}
